package com.unifiedlibrary.amall_page.module.offerlist;

import android.os.Bundle;

import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.unifiedlibrary.amall_page.R;

/**
 * 优惠列表页面
 */
public class OfferListFragment extends Fragment {

    private RecyclerView recy_offer_list;

    public OfferListFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View containtView = inflater.inflate(R.layout.fragment_offer_list, container, false);
        initView(containtView);
        return containtView;
    }

    private void initView(View containtView){
        recy_offer_list = containtView.findViewById(R.id.recy_offer_list);

        LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getContext());
        OfferListAdapter offerListAdapter = new OfferListAdapter(getContext());
        recy_offer_list.setLayoutManager(linearLayoutManager);
        recy_offer_list.setAdapter(offerListAdapter);
    }
}
